<header class="container-fluid">
  <div class="container">
    <div class="pull-left logo">
      <a href="/">
        <img src="/assets/images/logo.gif" alt="">
      </a>
    </div>
    <div class="pull-left" *ngIf="hasHeaderAdditional">
      <ul class="list-unstyled list-inline center-ul">
        <li><a routerLink="./store-product/goods-manage">小程序数据管理</a></li>
        <!--<li><a routerLink="./preview">预览</a></li>-->
        <!--<li>-->
          <!--<a routerLink="./authorization">-->
            <!--授权-->
            <!--<div class="nav-tips" *ngIf="!authorizetion_status">未授权</div>-->
          <!--</a>-->
        <!--</li>-->
        <!--<li>-->
          <!--<a href="javascript:;" (click)="release()">-->
            <!--发布-->
            <!--<div class="nav-tips" *ngIf="!publish_status">未发布</div>-->
          <!--</a>-->
        <!--</li>-->
        <!-- <li><a routerLink="./applet-setting/authorization">小程序设置</a></li> -->
        <li><a routerLink="/member/applet-setting/authorization">小程序设置</a></li>
        <li class="omit" title="{{appletName}}">当前小程序:{{appletName}}</li>
      </ul>
    </div>
    <div class="pull-right">
      <ul class="list-unstyled list-inline right-ul">
        <li (click)="accountDlg()">
        <!--<li>-->
          <img *ngIf="!head_img" src="/assets/images/main-header-default.png" alt="" class="head_img">
          <img *ngIf="head_img" src="{{aliyunOssOutputUrl+'/'+head_img}}" alt="" class="head_img">
          <a href="javascript:;" class="name_omit" title="{{hadLoginName}}">{{hadLoginName}}</a>
        </li>
        <li><a routerLink="index">我的小程序</a></li>
        <li><a href="javascript:;" (click)="clear()">退出登录</a></li>
      </ul>
    </div>
  </div>
</header>

<div class="modal fade" bsModal #personModal="bs-modal" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close pull-right" aria-label="Close" (click)="personModal.hide()">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="container-fluid clearfix">
        <div class="text-center mb20">
          <div class="ui-radio" [class.ui-radioed]="modifiedType == 'account'" (click)="modifiedType = 'account'"><i
            class="iconfont icon-iconfontradiobox"></i><span>账户修改</span>
            <input type="radio" name="" value="">
          </div>
          <div class="ui-radio" [class.ui-radioed]="modifiedType == 'password'" (click)="modifiedType = 'password'"><i
            class="iconfont icon-iconfontradiobox"></i><span>密码修改</span>
            <input type="radio" name="" value="">
          </div>
        </div>
        <div class="col-sm-3" *ngIf="modifiedType == 'account'">
          <div class="header-warp">
            <div class="photo-warp">
              <input type="file" class="header-photo-file" name="head_img" (change)="uploadImg($event)">
              <div class="edvert-photo-warp">
                <img class="imgSize" src="{{img_url}}">
              </div>
            </div>

            <h3 class="photo-title">上传头像</h3>
            <p class="photo-tips">免费版</p>
          </div>
        </div>
        <div class="col-sm-8" *ngIf="modifiedType == 'account'">
          <div class="info-warp">
            <form #accountForm="ngForm">
              <!--<h3 class="change-msg-title">账户修改</h3>-->
              <div class="form-group clearfix">
                <label class="col-md-3">昵称</label>
                <div class="col-md-9">
                  <input type="text" class="form-control" name="nick_name" [(ngModel)]="accountInfo.nick_name" required>
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="col-md-3">性别</label>
                <div class="col-md-9">
                  <div class="ui-radio" [class.ui-radioed]="accountInfo.sex == '男'" (click)="accountInfo.sex = '男'"><i
                    class="iconfont icon-iconfontradiobox"></i><span>男</span>
                    <input type="radio" name="" value="">
                  </div>
                  <div class="ui-radio" [class.ui-radioed]="accountInfo.sex == '女'" (click)="accountInfo.sex = '女'"><i
                    class="iconfont icon-iconfontradiobox"></i><span>女</span>
                    <input type="radio" name="" value="">
                  </div>
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="col-md-3"><span class="c-red">*</span>公司名称</label>
                <div class="col-md-9">
                  <input type="text" class="form-control" name="company_name" [(ngModel)]="accountExtend.company_name" required>
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="col-md-3"><span class="c-red">*</span>服务类目</label>
                <div class="col-md-9 form-inline" >
                  <select class="form-control" [(ngModel)]="fir" (change)="getAllClass(fir, 'secClass')" name="fir" >
                    <option value="0">一级类目</option>
                    <option value="{{item.id}}&{{item.class_name}}" *ngFor="let item of firClass">{{item.class_name}}</option>
                  </select>
                  <select class="form-control" [(ngModel)]="sec" name="sec">
                    <option value="0">二级类目</option>
                    <option value="{{item.id}}&{{item.class_name}}" *ngFor="let item of secClass">{{item.class_name}}</option>
                  </select>
                  <a href="javascript:;" class="text-right" (click)="addAccountClass()">添加</a>
                </div>
                <div class="col-md-9 col-md-push-3"><div class="col-md-6" *ngFor="let item of accountClass;let i=index"><span class="omit" title="{{item.firName}} {{item.secName}}">{{item.firName}} {{item.secName}}</span> <i class="iconfont icon-cuowu" (click)="accountClass.splice(i,1)"></i></div></div>
              </div>
              <div class="form-group clearfix">
                <label class="col-md-3">公司地址</label>
                <div class="col-md-9 form-inline">
                  <select class="form-control" [(ngModel)]="provinceCode" name="province" (change)="changeProvince()">
                    <option value="0">省</option>
                    <option value="{{item.code}}" *ngFor="let item of provinceList">{{item.name}}</option>
                  </select>
                  <select class="form-control" [(ngModel)]="cityCode" name="city" (change)="changeCity()">
                    <option value="0">市</option>
                    <option value="{{item.code}}" *ngFor="let item of cityList">{{item.name}}</option>
                  </select>
                  <select class="form-control" [(ngModel)]="regionCode" name="region" (click)="changeRegion()">
                    <option value="0">区</option>
                    <option value="{{item.code}}" *ngFor="let item of regionList">{{item.name}}</option>
                  </select>
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="col-md-3"></label>
                <div class="col-md-9">
                  <input type="text" class="form-control" placeholder="详细地址" name="address_detail" [(ngModel)]="accountExtend.company_address_detail" required>
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="col-md-3"><span class="c-red">*</span>联系人姓名</label>
                <div class="col-md-9">
                  <input type="text" class="form-control" name="name" [(ngModel)]="accountExtend.contacts" required>
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="col-md-3"><span class="c-red">*</span>联系人手机</label>
                <div class="col-md-9">
                  <input type="number" class="form-control" name="mobile" #mobile="ngModel" [(ngModel)]="accountExtend.contacts_mobile" required appValidateMobile>
                  <div [hidden]="mobile?.valid || mobile?.pristine" class="alert alert-danger">
                    <p *ngIf="mobile?.errors?.required">必须输入</p>
                    <p *ngIf="mobile?.errors?.validateMobile">格式不正确</p>
                  </div>
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="col-md-3">联系人邮箱</label>
                <div class="col-md-9">
                  <input type="text" class="form-control" name="email" [(ngModel)]="accountExtend.email">
                </div>
              </div>
              <div class="form-btn-warp">
                <button type="button" class="btn btn-md-long"  (click)="personModal.hide()">取　消</button>
                <button type="submit" class="btn btn-md-long btn-success" [disabled]="!accountForm.form.valid||!regionCode||accountInfo.sex=='未知'||!accountClass.length" (click)="accountEditSubmit()">保　存</button>
              </div>
            </form>
          </div>
        </div>
        <div class="text-center" *ngIf="modifiedType == 'password'">
          <div class="info-warp">
            <form #passwordForm="ngForm">
              <!--<h3 class="change-msg-title">密码修改</h3>-->
              <div class="form-group clearfix">
                <label class="col-md-3">原密码</label>
                <div class="col-md-7">
                  <input type="password" class="form-control" name="old_password" [(ngModel)]="passwordInfo.old_password">
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="col-md-3">新密码</label>
                <div class="col-md-7">
                  <input type="password" class="form-control" name="new_password" [(ngModel)]="passwordInfo.new_password">
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="col-md-3">确认密码</label>
                <div class="col-md-7">
                  <input type="password" class="form-control" name="again_password" [(ngModel)]="passwordInfo.again_password">
                </div>
              </div>
              <div class="form-btn-warp">
                <button type="button" class="btn btn-md-long" (click)="personModal.hide()">取　消</button>
                <button type="submit" class="btn btn-md-long btn-success" [disabled]="!passwordForm.form.valid||!canClick" (click)="passwordEditSubmit()">保　存</button>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<app-notification [type]="type" [message]="message" [isShow]="isShow" (promptIsShow)="isShow = $event;"></app-notification>
